package com.atguigu.gmall.cart.client;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.model.cart.CartInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @Description: TODO
 * @Author: Mr.Cao
 * @DateTime: 2021/10/19 8:58
 * BMW F750GS
 **/

@FeignClient("service-cart")
@Component
public interface CartFeignClient {
    /**
     * 添加购物项
     * */
    @PostMapping("/api/cart/addToCart/{skuId}/{skuNum}")
      void addToCart(
            @PathVariable Long skuId,
            @PathVariable Integer skuNum
    );

    /**
     * 添加完购物项后,跳转到购物车页面,并回显数据
     * */
    @GetMapping("/api/cart/toCart/{skuId}")
    CartInfo toCart(@PathVariable Long skuId);
    /**
     * 去结算页面显示,已经选中的商品
     * */
    @GetMapping("/api/cart/getCartInfoListByChecked")
    List<CartInfo> getCartInfoListByChecked();
}
